package com.bestsoft.baseinfo.service.impl;

import java.util.List;
import com.bestsoft.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestsoft.baseinfo.mapper.BaseInfoGoodsMapper;
import com.bestsoft.baseinfo.domain.BaseInfoGoods;
import com.bestsoft.baseinfo.service.IBaseInfoGoodsService;

/**
 * 商品资料Service业务层处理1
 * 
 * @author 王识宇
 * @date 2023-09-19
 */
@Service
public class BaseInfoGoodsServiceImpl implements IBaseInfoGoodsService
{
    @Autowired
    private BaseInfoGoodsMapper baseInfoGoodsDocMapper;

    /**
     * 查询商品资料
     * 
     * @param goodid 商品资料主键
     * @return 商品资料
     */
    @Override
    public BaseInfoGoods selectBaseInfoGoodsDocByGoodid(Long goodid)
    {
        return baseInfoGoodsDocMapper.selectBaseInfoGoodsDocByGoodid(goodid);
    }

    /**
     * 查询商品资料列表
     * 
     * @param baseInfoGoodsDoc 商品资料
     * @return 商品资料
     */
    @Override
    public List<BaseInfoGoods> selectBaseInfoGoodsDocList(BaseInfoGoods baseInfoGoodsDoc)
    {
        return baseInfoGoodsDocMapper.selectBaseInfoGoodsDocList(baseInfoGoodsDoc);
    }

    /**
     * 新增商品资料
     * 
     * @param baseInfoGoodsDoc 商品资料
     * @return 结果
     */
    @Override
    public int insertBaseInfoGoodsDoc(BaseInfoGoods baseInfoGoodsDoc)
    {
        baseInfoGoodsDoc.setCreateTime(DateUtils.getNowDate());
        return baseInfoGoodsDocMapper.insertBaseInfoGoodsDoc(baseInfoGoodsDoc);
    }

    /**
     * 修改商品资料
     * 
     * @param flowGoodsDoc 商品资料
     * @return 结果
     */
    @Override
    public int updateBaseInfoGoodsDoc(BaseInfoGoods flowGoodsDoc)
    {
        flowGoodsDoc.setUpdateTime(DateUtils.getNowDate());
        return baseInfoGoodsDocMapper.updateBaseInfoGoodsDoc(flowGoodsDoc);
    }

    /**
     * 批量删除商品资料
     * 
     * @param goodids 需要删除的商品资料主键
     * @return 结果
     */
    @Override
    public int deleteBaseInfoGoodsDocByGoodids(Long[] goodids)
    {
        return baseInfoGoodsDocMapper.deleteBaseInfoGoodsDocByGoodids(goodids);
    }

    /**
     * 删除商品资料信息
     * 
     * @param goodid 商品资料主键
     * @return 结果
     */
    @Override
    public int deleteBaseInfoGoodsDocByGoodid(Long goodid)
    {
        return baseInfoGoodsDocMapper.deleteBaseInfoGoodsDocByGoodid(goodid);
    }
}
